package com.tz.entity;

import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2017/1/6.
 */
@Component(value = "ssd")
@Primary  //优先使用
public class Ssd extends HardDisk {

    private SsdType type;  //固态硬盘类型

    public Ssd(int capacity, String vendor, SsdType type) {
        super(capacity, vendor);
        this.type = type;
    }

    public Ssd(SsdType type) {
        this.type = type;
    }

    public Ssd() { }

    public SsdType getType() {
        return type;
    }

    public void setType(SsdType type) {
        this.type = type;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Ssd{");
        sb.append(super.toString()).append(" type=").append(type);
        sb.append('}');
        return sb.toString();
    }
}
